package com.wyw.hemerocallis.feign;

import com.wyw.hemerocallis.common.TableId;
import com.wyw.hemerocallis.feign.hystrix.GoodsClientHystrix;
import com.wyw.hemerocallis.goods.SimpleGoodsInfo;
import com.wyw.hemerocallis.vo.CommonResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * 安全的商品服务 Feign 接口
 *
 * @author Mr Wu    yewen.wu.china@gmail.com
 * <p>
 * Update History:
 * Author        Time            Content
 */
@FeignClient(
        contextId = "SecuredGoodsClient",
        value = "hemerocallis-goods-service",
        fallback = GoodsClientHystrix.class
)
public interface SecuredGoodsClient {

    /**
     * 根据ids查询简单的商品信息
     */
    @RequestMapping(
            value = "/hemerocallis-goods-service/goods/simple-goods-info",
            method = RequestMethod.POST
    )
    CommonResponse<List<SimpleGoodsInfo>> getSimpleGoodsInfoByTableId(
            @RequestBody TableId tableId
            );
}
